package test.gateway.b.remote;

import com.sanri.dtos.IdcardQueryParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

import java.util.Date;

@FeignClient(value = "servicea",fallbackFactory = CommonFallback.class)
public interface IdcardService {

    @GetMapping("/idcard")
    String idcard(@RequestBody IdcardQueryParam complexDto);

    @GetMapping("/echo")
    String echo(@RequestParam("msg") String msg);

    @GetMapping(value = "/idcard/echo",consumes =  MediaType.APPLICATION_FORM_URLENCODED_VALUE)
    String idcardEcho(IdcardQueryParam complexDto,@RequestParam("msg") String msg);

    @GetMapping("/token")
    String token();

    /**
     * 测试日期参数
     * @param begin
     * @param end
     * @return
     */
    @GetMapping("/reciveDate")
    String reciveDate(@RequestParam("begin") Date begin,@RequestParam("end") Date end);

    /**
     * 测试 cookie 值
     * @return
     */
    @GetMapping("/cookieValue")
    String cookieValue();
}
